#!/bin/sh

NU='./libnusqlite3.so'

echo ".load $NU sqlite3_nunicode_init"

while read -r SQL; do
	if [ -z "$SQL" ]; then
		continue
	fi

	ESCAPED_SQL=$(echo "$SQL" | sed -r "s|'|''|g")
	echo "SELECT '$ESCAPED_SQL: ' || (CASE WHEN ($SQL) THEN 'OK' ELSE 'FAILED' END);"
done
